module.exports = function(app) {

    var isLoggedIn = require('../app/util/authUtil').isLoggedIn;
    var svnLogController = require('../app/controller/svnLogController');

    var routes_get = [];
    var routes_post = ['query', 'querySvnPath'];

    /**
     * 首页
     */
    app.get('/svnLog', isLoggedIn);
    app.get('/svnLog', function(req, res) {
        res.render('svnLog/index');
    });

    for (var i = 0; i < routes_get.length; i++) {
        (function(_routeName) {
            app.get('/svnLog/' + _routeName, isLoggedIn);
            app.get('/svnLog/' + _routeName, function(req, res) {
                svnLogController[_routeName](req, res);
            });
        }(routes_get[i]));
    }

    for (var i = 0; i < routes_post.length; i++) {
        (function(_routeName) {
            app.post('/svnLog/' + _routeName, isLoggedIn);
            app.post('/svnLog/' + _routeName, function(req, res) {
                svnLogController[_routeName](req, res);
            });
        }(routes_post[i]));
    }

};